import 'package:flutter/material.dart';
import 'package:flutter_cate/ui/pages/main/main.dart';
import 'package:flutter_cate/ui/pages/meal/meal.dart';
import 'package:flutter_cate/ui/pages/filter/filter.dart';
import 'package:flutter_cate/ui/pages/detail/detail.dart';

class AMRouter {
  static final String initialRoute = AMMainScreen.routeName;

  static final Map<String, WidgetBuilder> routes = {
    AMMainScreen.routeName : (ctx) => AMMainScreen(),
    AMMealScreen.routeName : (ctx) => AMMealScreen(),
    AMDetailScreen.routeName : (ctx) => AMDetailScreen(),
  };

  static final RouteFactory generateRoute = (settings) {
    if (settings.name == AMFilterScreen.routeName) {
      return MaterialPageRoute(
          builder: (ctx) {
            return AMFilterScreen();
          },
        fullscreenDialog: true
      );
    }
    return null;
  };

  static final RouteFactory unknownRoute = (settings) {
    return null;
  };
}